<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
   <div id="app">
       <input type="text" @keydown="demo01($event)"/>
       <input type="text" @keydown.enter="demo02"/>
   </div>
</body>
<script>
    new Vue({
        el:"#app",
        methods:{
            demo01(e){
                if(e.key=="Enter"){
                    alert("你按下了回复按钮")
                }
            },
            demo02(){
                alert(2222)
            }
        }
    })
</script>
</html>